//
//  CommentTableViewCell.m
//  CarFace
//
//  Created by dlios on 15-3-24.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "CommentTableViewCell.h"

@implementation CommentTableViewCell

- (void)dealloc
{
    [_iconView release];
    [_titLabel release];
    [_luckLable release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.iconView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.iconView];
        [_iconView release];
        
        self.titLabel = [[UILabel alloc]init];
        self.titLabel.font = [UIFont systemFontOfSize:16.0f];
        [self.contentView addSubview:self.titLabel];
        [_titLabel release];
        
        self.luckLable = [[UILabel alloc]init];
        self.luckLable.font = [UIFont systemFontOfSize:14.0f];
        self.luckLable.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.luckLable];
        [_luckLable release];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat width = self.contentView.bounds.size.width;
    CGFloat height = self.contentView.bounds.size.height;
    self.iconView.frame = CGRectMake(7, 7, width / 4 , height - 10);
    self.titLabel.frame = CGRectMake((width / 4) + 20 , 7, (width  * 3 / 4 - 27), height / 2);
    self.luckLable.frame = CGRectMake((width / 4) + 20, height / 2 + 10, (width  * 3 / 4 - 27), height / 4);
    
    NSString *imagename = self.comment.image;
    self.iconView.image = [UIImage imageNamed:imagename];
    
    self.titLabel.text = self.comment.title;
    self.luckLable.text = self.comment.luckTit;
   
   
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
